/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package uit.jee.lib.bo;

import java.util.ArrayList;
import uit.jee.lib.access.mapper.ReaderMapper;
import uit.jee.lib.dto.ReaderDTO;

/**
 *
 * @author ngloc_it
 */
public class ReaderBO {

    public boolean CheckExistedReader(String readerId) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        return mapper.CheckExistedReader(readerId);
    }

    public boolean CheckExistedReader(ReaderDTO reader) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        return mapper.CheckExistedReader(reader);
    }

    public ArrayList<ReaderDTO> GetAllReader() throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        return mapper.GetAllReader();
    }

    public ArrayList<ReaderDTO> GetReaderByName(String readerName) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        return mapper.GetReaderByName(readerName);
    }

    public ReaderDTO GetReaderById(String readerId) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        return mapper.GetReaderById(readerId);
    }

    public ReaderDTO GetReaderByCMND(String cmnd) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        return mapper.GetReaderByCMND(cmnd);
    }

    public void Update(ReaderDTO reader) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Update(reader);
    }

    public void Udpate(ReaderDTO[] readers) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Udpate(readers);
    }

    public void Insert(ReaderDTO reader) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Insert(reader);
    }

    public void Insert(ReaderDTO[] readers) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Insert(readers);
    }

    public void Delete(ReaderDTO reader) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Delete(reader);
    }

    public void Delete(ReaderDTO[] readers) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Delete(readers);
    }

    public void Delete(String id) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Delete(id);
    }

    public void Delete(String[] ids) throws Exception{
        ReaderMapper mapper = new ReaderMapper();
        mapper.Delete(ids);
    }
}
